package com.web;


import com.pojo.dto.Message;
import com.pojo.vo.SysUserVo;
import com.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class SysUserController {
    @Autowired
    SysUserService sysUserService;

    @PostMapping("/sysuser")
    public Message<List<SysUserVo>> findList(SysUserVo sysUserVo) {
        return sysUserService.list(sysUserVo);
    }

    @PostMapping("/sysusers")
    public Message<SysUserVo> get(Long id) {
        return sysUserService.get(id);
    }

    @PostMapping("/sysusers/add")
    public Message<SysUserVo> add(SysUserVo sysUserVo) {
        return sysUserService.add(sysUserVo);
    }

    @PostMapping("/sysusers/edit")
    public Message<SysUserVo> update(SysUserVo sysUserVo) {
        return sysUserService.edit(sysUserVo);
    }

    @PostMapping("/sysusers/sysuser/{id}")
    public Message<SysUserVo> delete(@PathVariable Long id) {
        return sysUserService.delete(id);
    }
}